package com.example.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.example.mapper.SysUserMapper;
import com.example.model.SysUser;
import com.xiaoyudeguang.annotations.RequestMapping;
import com.xiaoyudeguang.annotations.RestController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author 赵光
 */
@Slf4j
@RestController(value = "/sysUser", tags = "用户接口", author = "赵光")
public class SysUserController {

    @Autowired
    private SysUserMapper sysUserMapper;

    @RequestMapping(value = "/getSysUser", summary = "获取用户信息")
    public SysUser getSysUser(@RequestParam String userNo) {
        List<SysUser> userList = sysUserMapper.selectList(Wrappers.lambdaQuery());
        log.info("userList:{}", userList);
        return SysUser.builder().userNo(userNo).userName("用户" + userNo).build();
    }
}
